package office.dao.workflow;

import java.util.Iterator;
import java.util.Map;

import platform.common.dao.impl.BaseDomainProviderImpl;

public class WorkTaskDP extends BaseDomainProviderImpl{
	
	//方法描述: 根据条件获取待办任务列表
	public String findWorkTaskByCondition(Map condMap){
		StringBuffer strBuf = new StringBuffer();
		strBuf.append(" from "+ this.getDomainClassName() + " where 1=1 ");
		Iterator it = condMap.keySet().iterator();
		while(it.hasNext()){
			String str = (String)it.next();
			if(str.equals("id")){
				strBuf.append(" and id ='"+condMap.get(str)+"' ");
			}
			if(str.equals("name")){
				strBuf.append(" and name like '%"+condMap.get(str)+"%' ");
			}
			if(str.equals("objId")){
				strBuf.append(" and objId ='"+condMap.get(str)+"' ");
			}
			if(str.equals("objClassName")){
				strBuf.append(" and objClassName ='"+condMap.get(str)+"' ");
			}
			if(str.equals("submitUser")){
				strBuf.append(" and submitUser ='"+condMap.get(str)+"' ");
			}
			if(str.equals("handleUser")){
				strBuf.append(" and handleUser ='"+condMap.get(str)+"' ");
			}
			if(str.equals("handleState")){
				strBuf.append(" and handleState ='"+condMap.get(str)+"' ");
			}
		}
		return strBuf.toString();
	}
}
